<!DOCTYPE html>
<!--
==========================================================================
gin-sns自动生成列表页面代码,只生成一次,按需修改.
date：2021-02-21 13:45:53 +0800 CST
path: template/module/answer/list.html
author：jon
==========================================================================
-->
<html lang="zh">
<head>
    {{template "header" (OssUrl)}}
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>    
                        <li>
                            <p>用户id：</p>
                            <input type="text" name="userId"/>
                        </li>
                            
                        <li>
                            <p>回答问题的id：</p>
                            <input type="text" name="questionId"/>
                        </li>
                                
                        <li>
                            <p>问题权重：</p>
                            <input type="text" name="weight"/>
                        </li>
                            
                        <li>
                            <p>赞同数量：</p>
                            <input type="text" name="countLike"/>
                        </li>
                            
                        <li>
                            <p>反对数量：</p>
                            <input type="text" name="countUnlike"/>
                        </li>
                            
                        <li>
                            <p>打赏数量：</p>
                            <input type="text" name="countReward"/>
                        </li>
                            
                        <li>
                            <p>收藏数量：</p>
                            <input type="text" name="countFavor"/>
                        </li>
                            
                        <li>
                            <p>分享数量：</p>
                            <input type="text" name="countShare"/>
                        </li>
                            
                        <li>
                            <p>评论数量：</p>
                            <input type="text" name="countComment"/>
                        </li>
                              <li>
                                <p>0未审核 1正常状态 2审核未通过 3删除：</p>
                                <select name="status">
                                    <option value="">所有</option>
                                </select>
                            </li> 
                                  
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            {{getPermiButton .uid "module:answer:add" "$.operate.add()" "新增" "btn btn-success" "fa fa-plus"}}
            {{getPermiButton .uid "module:answer:edit" "$.operate.edit()" "修改" "btn btn-primary single disabled" "fa fa-edit"}}
            {{getPermiButton .uid "module:answer:remove" "$.operate.removeAll()" "删除" "btn btn-danger multiple disabled" "fa fa-remove"}}
            {{getPermiButton .uid "module:answer:export" "$.table.exportExcel()" "导出" "btn btn-warning" "fa fa-download"}}
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
{{template "footer" (OssUrl)}}
<script type="text/javascript">
    var editFlag = '{{hasPermi .uid "module:answer:edit"}}';
    var removeFlag = '{{hasPermi .uid "module:answer:remove"}}';

                                  
    var prefix = ctx + "module/answer";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit?id={id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "回答",
            columns: [
                {
                    checkbox: true
                },  
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },     
                {
                    field: 'user_id',
                    title: '用户id'
                },      
                {
                    field: 'question_id',
                    title: '回答问题的id'
                },      
                {
                    field: 'content',
                    title: '评论内容'
                },      
                {
                    field: 'weight',
                    title: '问题权重'
                },      
                {
                    field: 'count_like',
                    title: '赞同数量'
                },      
                {
                    field: 'count_unlike',
                    title: '反对数量'
                },      
                {
                    field: 'count_reward',
                    title: '打赏数量'
                },      
                {
                    field: 'count_favor',
                    title: '收藏数量'
                },      
                {
                    field: 'count_share',
                    title: '分享数量'
                },      
                {
                    field: 'count_comment',
                    title: '评论数量'
                },      
                {
                    field: 'status',
                    title: '0未审核 1正常状态 2审核未通过 3删除'
                },          
                {
                    field: 'last_comment_time',
                    title: '最后评论时间'
                },    
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>